package com.finer.controller;

import com.finer.entity.ResponseMessage;
import com.finer.feign.FinerCustomerFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("finerCustomer")
public class FinerCustomerController {
    @Autowired
    private FinerCustomerFeign finerCustomerFeign;

    private Logger logger = LoggerFactory.getLogger(FinerCustomerController.class);
    @RequestMapping("getCustomerList")
    public ResponseMessage getCustomerList(@RequestBody Map map){
        logger.info("consumer FinerCustomerController getCustomerList  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerFeign.getCustomerList(map);
        return responseMessage;
    }

    @RequestMapping("delCus")
    public ResponseMessage delCus(@RequestBody Map map){
        logger.info("consumer FinerCustomerController delCus  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerFeign.delCus(map);
        return responseMessage;
    }

    @RequestMapping("addCus")
    public ResponseMessage addCus(@RequestBody Map map){
        logger.info("consumer FinerCustomerController addCus  start....map:"+map);
        ResponseMessage responseMessage = finerCustomerFeign.addCus(map);
        return responseMessage;
    }
}
